<template>
	<view>
	
			<scroll-view style="height:100vh;"  :scroll-y="true" @scrolltolower="scrolltolowerfn">
				<view>
			<view class="" v-for="(item,index) in lists" :key="index">
			<longtime-item :item="item"></longtime-item>
			
			</view>
			<view class="flex-content" style="width: 100%;">
				暂无更多订单
			</view>
			</view>
		</scroll-view>

	</view>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import {
		businessOrderlist
	} from '@/api/order'
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				lists:[],
						
							scroll:{
								limit:10,
								page:1,
							},
			                pagecount:""
			}
		},
		onShow() {
			this.scroll.page=1
			this.lists=[]
			this.getdata()
			
			this.$forceUpdate()
		},
		
		methods: {
			
				async scrolltolowerfn(){
							
							this.scroll.page=this.scroll.page+1
							if(this.scroll.page<=this.pagecount){
								await this.getdata()
							}
							
						},
						async getdata(){
						let res=await businessOrderlist(this.scroll)
						
							this.pagecount=Math.ceil(res.data.count/10)
						
							
							this.lists=[...this.lists,...res.data.lists]
							return res.data
								
						},
		},
	
	}
</script>

<style lang="scss" scoped>
	



</style>
